Conversation
of connection lifetime
…ity-Technologies/com.unity.netcode.gameobjects into bugfix/MTT-3389_packet-loss-amortized
|
I understand the benefit of tracking packet loss on a smaller time scale, but I'm worried that a frame is too small a scale. I don't think we see enough packets per frame to gather a good metric of packet loss on the network. For example, if 10 packets are received per frame (which would be a consequent volume of traffic), then packet loss can't be lower than 10% for any frame. Users are only likely to see long periods of 0% packet loss, interspersed with spikes of 10%-20%. That's not practical to figure out packet loss on the network, since you then have to count the total number of frames between these spikes (e.g. a 10% spike every 10 frame means 1% packet loss on the network, which is a more realistic and useful figure). I think tracking packet loss over periods of say a second might be more useful and accurate. |
We decided to go this route as RNSM actually allow you to configure over how many samples and how long you want the packet loss to be. Since this is used by the tools, it's an easy way to get the value and leave in the end of the user how much precision and flexibility they want. |
NoelStephensUnity
left a comment
There was a problem hiding this comment.
Other than the very minor whitespace issue, it looks good to me.
| // In those situation we want to return the last packet loss value instead of 0 to avoid invalid swings | ||
| if (packetDroppedDelta == 0 && packetReceivedDelta == 0) | ||
| { | ||
| return m_PacketLossCache.PacketLoss; |
There was a problem hiding this comment.
Would it make sense to return 0 in this case? It would mean that you don't need to store the previous value 🤔
There was a problem hiding this comment.
Just a question, maybe what you have is already the best approach
ian-m-unity
left a comment
There was a problem hiding this comment.
Approved with one suggestion :)
Fix the way the packet loss was calculated where it was over a connection lifetime instead of a frame.
MTT-3389
Changelog
PacketLosswould return the packet loss over a connection lifetime instead of a single frame.Testing and Documentation